home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 43
/
Aminet 43 (2001)(GTI - Schatztruhe)[!][Jun 2001].iso
/
Aminet
/
game
/
patch
/
WHDWhiteSnook.lha
/
WHD_JimmyWhiteSnooker
/
InstallSG
< prev
next >
Wrap
Text File
|
2001-04-03
|
4KB
|
151 lines
;------------------------------------------------------------------------------------
; Checks if given program is reachable via the path
; if not abort install
(procedure P_CheckRun (
(if (<> 0 (run (cat "Which " #VPROGRAM)))
(abort
(cat
"Could not find the program\n\n"
"'" #VPROGRAM "'\n\n"
"required to perform the installation!\n\n"
"Please install the '" #VPROGRAM "' program ensuring that\n"
"it is accessible on the path, then try the installation again."
)
)
)
))
;------------------------------------------------------------------------------------
; Make save data
(procedure P_InstallSave (
;
; Get save disk inserted
;
(message
(cat "\n\n\nPlease insert your saved game disk in drive DF0:\n\n"
"Click 'Proceed' when ready."
)
)
;
; Back up any existing save files
;
(set #VT1 (tackon #VDATDIR "SaveDat.6B4"))
(set #VT2 (tackon #VDATDIR "SaveDat.6B4.old"))
(if (= 1 (exists #VT1))(
(if (= 1 (exists #VT2)) (delete #VT2 (optional fail force)) )
(rename #VT1 #VT2)
))
(set #VT1 (tackon #VDATDIR "SaveDat.6CA"))
(set #VT2 (tackon #VDATDIR "SaveDat.6CA.old"))
(if (= 1 (exists #VT1))(
(if (= 1 (exists #VT2)) (delete #VT2 (optional fail force)) )
(rename #VT1 #VT2)
))
;
; Run the save extractor
;
(set #VOLDEXEDIR @execute-dir)
(set @execute-dir #VDATDIR)
(run (cat "RawDIC SLAVE=\"" (tackon #VDATDIR "JWWSMakeSave") "\""))
(set @execute-dir #VOLDEXEDIR)
;
; Did the save install work?
; Check that the files were created
;
(set #VOK 1)
(if (<> (getsize (tackon #VDATDIR "SaveDat.6B4")) 5632)
(set #VOK 0)
)
(if (<> (getsize (tackon #VDATDIR "SaveDat.6CA")) 5632)
(set #VOK 0)
)
;
; Restore previous save files if installation failed
;
(if (= 0 #VOK)(
(set #VT1 (tackon #VDATDIR "SaveDat.6B4"))
(set #VT2 (tackon #VDATDIR "SaveDat.6B4.old"))
(if (= 1 (exists #VT2))( (rename #VT2 #VT1) ))
(set #VT1 (tackon #VDATDIR "SaveDat.6CA"))
(set #VT2 (tackon #VDATDIR "SaveDat.6CA.old"))
(if (= 1 (exists #VT2))( (rename #VT2 #VT1) ))
(abort (cat "*** Savegame installation failed! ***\n\n"
"No existing save positions have been changed"
)
)
))
(message "\n\n\n\nSavegame installation successful!")
))
;------------------------------------------------------------------------------------
(welcome "Welcome to the Jimmy White's Whirlwind Snooker Savegame installer")
(set @app-name "Jimmy White's Whirlwind Snooker Savegame")
(set #VOLDEXEDIR @execute-dir)
(if (<> @user-level 2)
(abort "You must select 'Expert' user level")
)
(if (< @installer-version 2818051)
(abort "This product requires at least version 43.3 of the Installer program")
)
;
; Check programs available
;
(set #VPROGRAM "RawDIC")
(P_CheckRun)
(message "\n\nWelcome to the Jimmy White's Whirlwind Snooker Savegame installer"
"\n© 1998-2001 John Girvin/Halibut Software\n\n"
"*** YOU MUST HAVE INSTALLED THE GAME BEFORE ***\n"
"*** ATTEMPTING TO INSTALL ANY SAVED GAMES ! ***\n\n"
"Please read the documentation thoroughly before"
" attempting to use this installer!\n\n"
"This is release 0401.1\n\n"
"Click 'Proceed' to begin."
)
;
; Get directory JWWS lives in
;
(set #VOK 0)
(while (= 0 #VOK)
(
(set #VROOTDIR
(askdir
(prompt "Where do you have Jimmy White's Whirlwind Snooker installed?\n"
"(select the directory containing the 'Jimmy White Snooker' icon)"
)
(help @askdir-help)
(default @default-dest)
(disk)
)
)
(if (= 1 (exists (tackon #VROOTDIR "JWWSHD")))
(set #VOK 1)
)
)
)
(set #VDATDIR (tackon #VROOTDIR "data/"))
;
; Install the save data
;
(P_InstallSave)
;================================================================================
;$VER: JWWS Savegame Installer script R0401.1 © 1998-2001 John Girvin/Halibut Software;================================================================================